package bukebianJH.Mapdemo;

import java.util.Map;
import java.util.Set;

public class Test1 {
    public static void main(String[] args) {
        Map<Integer, String> obj = Map.of(1, "a", 2, "b", 3, "c");

        Set<Integer> keys = obj.keySet();

        for (Integer key : keys) {
            String value = obj.get(key);
            System.out.println(key + "=" + value);
        }

        System.out.println("===================");

        Set<Map.Entry<Integer, String>> entries = obj.entrySet();
        for (Map.Entry<Integer, String> entry : entries) {
            Integer key = entry.getKey();
            String value = entry.getValue();
            System.out.println(key + "=" + value);
        }
    }
}
